using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

namespace OrigPacman
{
    public class Waypoint
    {
        #region Variables
        protected Vector2 position;
        protected Dictionary<Direction, int> directions;
        protected Rectangle container;
        protected int size;
        #endregion

        #region Properties
        public Vector2 Position
        {
            get { return position; }
            set 
            { 
                position = value;
                container.X = (int)position.X;
                container.Y = (int)position.Y;
            }
        }
        public int West
        {
            get
            {
                return directions[Direction.WEST];    
            }
            set 
            { 
                directions[Direction.WEST] = value;
            }
        }
        public int East
        {
            get
            {
                return directions[Direction.EAST];    
            }
            set 
            { 
                directions[Direction.EAST] = value;
            }
        }
        public int North
        {
            get
            {
                return directions[Direction.NORTH];    
            }
            set 
            { 
                directions[Direction.NORTH] = value;
            }
        }
        public int South
        {
           get
            {
                return directions[Direction.SOUTH];    
            }
            set 
            { 
                directions[Direction.SOUTH] = value;
            }
        }
        public Rectangle Bounds
        {
            get { return container; }
            set
            {
                container = value;
                position = new Vector2(container.X, container.Y);
            }
        }
        public int Size
        {
            get { return size; }
            set
            {
                size = value;
                container.Width = size;
                container.Height = size;
            }
        }
        #endregion

        public Waypoint()
        {
            position = new Vector2(0.0f, 0.0f);
            size = 16;
            container = new Rectangle(0, 0, size, size);
            directions = new Dictionary<Direction, int>();
            directions.Add(Direction.EAST, int.MaxValue);
            directions.Add(Direction.WEST, int.MaxValue);
            directions.Add(Direction.NORTH, int.MaxValue);
            directions.Add(Direction.SOUTH, int.MaxValue);
        }
    }
}

